{% extends "layout.html" %}

{% block content %}

<table>
  <thead>
      <tr>
          <th>标题</th>
          <th>发布时间</th>
      </tr>
  </thead>
  <tbody>
      {% for article in articles %}
      <tr>
          <td>{{ article.title }}</td>
          <td>{{ article.publish_date }}</td>
      </tr>
      {% endfor %}
  </tbody>
</table>

<!-- 分页导航 -->
<div class="pagination">
  <span class="step-links">
      {% if articles.has_previous %}
          <a href="?page=1">&laquo; 首页</a>
          <a href="?page={{ articles.previous_page_number }}">上一页</a>
      {% endif %}

      <span class="current">
          第 {{ articles.number }} 页 / 共 {{ paginator.num_pages }} 页
      </span>

      {% if articles.has_next %}
          <a href="?page={{ articles.next_page_number }}">下一页</a>
          <a href="?page={{ paginator.num_pages }}">末页 &raquo;</a>
      {% endif %}
  </span>
</div>
        
{% endblock %}